<?php
class TBB_Model_City extends TBB_Db_Table_Abstract
{
	/**
	 * Model name
	 * @var string
	 */
	protected $_name = 'city';
	
	/**
	 * Primary column
	 * @var string
	 */
	protected $_primary = 'city_id';
	
	/**
	 * Get city array
	 * @return array
	 */
	private function _getCityArray()
	{
		$select = $this->select()->order('city_name');
		$r = $this->fetchAll($select);
		return $r ? $r->toArray() : array(); 
	}
	
	/**
	 * Get cityName-cityName map
	 * @return array
	 */
	public function getCityNameCityNameMap()
	{
		$cities = $this->_getCityArray();
		$result = array();
		foreach($cities as $city) {
			$result[$city['city_name']] = $city['city_name'];	
		}
		return $result;		
	}
}